﻿using System;
using System.Collections.Generic;

namespace zuoye444
{
    class Program
    {
        //4.分拣奇偶数 int[]{1,2,3,4,5,6,7,8,9}
        //将

        static void Main(string[] args)
        {
            int[] nums = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            List<int> listJi = new List<int>();
            List<int> listOu = new List<int>();
            for (int i = 0; i < nums.Length; i++)
            {
                if (nums[i] % 2 == 0)
                {
                    listOu.Add(nums[i]);
                }
                else
                {
                    listJi.Add(nums[i]);
                }
            }
            Console.WriteLine("奇数：");
            Console.WriteLine(string.Join(" ", listJi));
            Console.WriteLine("偶数：");
            Console.WriteLine(string.Join(" ", listOu));


        }

    }
}
